import os
from langchain_community.llms.tongyi import Tongyi
from langchain_core.prompts import PromptTemplate

os.environ["DASHSCOPE_API_KEY"] = "sk-9d8f1914800e497f8717144e860f99bc"
llm = Tongyi()
prompt = PromptTemplate(input_variables=["topic", "language"],
                        template="Tell me a joke about {topic} and in {language} language")

res = prompt.format(topic="funny", language="english")
print(res)
